package com.sc.nft.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

@AllArgsConstructor
@Getter
public enum ExpenditureRecordTypeEnum {
    RECHARGE(1, "充值", "https://cdn.gometa.com.cn//test1/scnft/3d_model/cz.png", true,2),
    WITHDRAW(2, "提现", "https://cdn.gometa.com.cn//test1/scnft/3d_model/tx.png", false,4),
    EXPENDITURE(3, "消费", "https://cdn.gometa.com.cn//test1/scnft/3d_model/xf.png", false,5),
    SELL(4, "出售", "https://cdn.gometa.com.cn//test1/scnft/3d_model/cs.png",  true,3),
    BACKSTAGE_ADD(5, "系统加款", "https://cdn.gometa.com.cn//scnft/h5_default/system.png", true,6),
    BACKSTAGE_SUB(6, "系统扣款", "https://cdn.gometa.com.cn//scnft/h5_default/system.png", false,6),
    RED_PACKET(7, "MT原石", "https://cdn.gometa.com.cn/scnft/h5_default/1C48BB85F56BE7FC", true,1),
    RED_PACKET_DEDUCTION(8, "MT原石抵扣", "https://cdn.gometa.com.cn/scnft/h5_default/1C48BB85F56BE7FC", false,1),
    SERVICE_CHARGE_SHARE_OUT_BONUS(9, "手续费分润", "https://cdn.gometa.com.cn/scnft/h5_default/1C48BB85F56BE7FC", true,1),
    CASTELLAN_CASH_BACK(10, "城主红包返现", "https://cdn.gometa.com.cn/scnft/h5_default/1C48BB85F56BE7FC", true,1),
    RESIDENT_CASH_BACK(11, "居民卡红包返现", "https://cdn.gometa.com.cn/scnft/h5_default/1C48BB85F56BE7FC", true,1),
    DEPOSIT_PAYMENT(12, "保证金充值", "https://cdn.gometa.com.cn//scnft/h5_default/F0F138E3E83E9C54",false,2),
    DEPOSIT_RELEASED(13, "保证金退款", "https://cdn.gometa.com.cn//scnft/h5_default/F0F138E3E83E9C54",true,6),
    URBAN_SERVICE_CENTER_INCREASES_THE_LEVEL_OF_INCOME(14, "手续费分润", "https://cdn.gometa.com.cn//scnft/h5_default/634959AB35AD3612",true,1),
    CHARGE_RETURN(15, "手续费返点", "https://cdn.gometa.com.cn//scnft/h5_default/634959AB35AD3612",true,1),
    IP_MALL_REFUND(16, "退款", "https://cdn.gometa.com.cn//scnft/h5_default/system.png",true,6),
    //名称需要用到关联表中的,code值固定
    RANKING_BOARD_INCOME(17, "持仓排名激励", "https://cdn.gometa.com.cn/scnft/h5_default/1C48BB85F56BE7FC",Boolean.TRUE,1),
    IP_MALL_RANKING_BOARD_INCOME(18, "IP商城交易激励", "https://cdn.gometa.com.cn/scnft/h5_default/1C48BB85F56BE7FC",Boolean.TRUE,1),
    WISH_BALANCE_DEDUCTION(19, "购物金抵扣", "https://cdn.gometa.com.cn/scnft/h5_default/1C48BB85F56BE7FC", false,7),
    WISH_BALANCE_ADD(20, "心愿礼金发放", "https://cdn.gometa.com.cn/scnft/h5_default/1C48BB85F56BE7FC", true,7),
    COPYRIGHT(21, "IP商城", "https://cdn.gometa.com.cn/scnft/h5_default/9803B6A58706D320", true,8),// 版权收益
    SUPPLY_CHAIN(22, "IP商城", "https://cdn.gometa.com.cn/scnft/h5_default/9803B6A58706D320", true,8),//供应商推荐
    TRANSFER_FAIL(23, "转账退回", "https://cdn.gometa.com.cn//scnft/h5_default/system.png",true,6),
    SHARE_GROUP_REWARDS(24,"分享购成团奖励","https://cdn.gometa.com.cn/scnft/h5_default/1C48BB85F56BE7FD",true,6),
    TRANSFER_HUIFU(25, "转账汇付", "https://cdn.gometa.com.cn//scnft/h5_default/system.png",false,9),
    TRANSFER_SAND(26, "转账衫德", "https://cdn.gometa.com.cn//scnft/h5_default/system.png",false,9),
    TRANSFER_LL(28, "转账连连", "https://cdn.gometa.com.cn//scnft/h5_default/system.png",false,9),
    TRANSFER_DAO(27, "转账企业钱包", "https://cdn.gometa.com.cn//scnft/h5_default/system.png",false,9),
    TRANSFER_HNA(29, "转账新生", "https://cdn.gometa.com.cn//scnft/h5_default/system.png",false,9),
    REFUND(30, "退款", "https://cdn.gometa.com.cn//scnft/h5_default/system.png",true,6),
    META_MAP(31, "版图分红", "https://cdn.gometa.com.cn//scnft/h5_default/system.png",true,6),
    MALL_SHOPPING_ALLOWANCE_PAY(32, "购物金退款", "https://cdn.gometa.com.cn/scnft/h5_default/1C48BB85F56BE7FC",true,7),
    PLANT_AMOUNT(33, "平台款项(手续费、分红等需要后置处理的金额)", "https://cdn.gometa.com.cn//scnft/h5_default/system.png", false,6),
    SHARE_AMOUNT(34, "直推", "https://cdn.gometa.com.cn//scnft/h5_default/system.png", false,6),
    ;

    @EnumValue
    private int code;

    private String description;

    private String imageUrl;

    private boolean isAdd;

    // 类别.  1: 红包 2:充值 3:出售 4:提现 5:消费 6:系统 7:心愿礼金 8:版权 9:转账
    private Integer type;



    public static List<Integer>byTypeGetList(Integer type){
        List<Integer>list=new ArrayList<>();
        // 根据type获取code集合
        ExpenditureRecordTypeEnum[] values = values();
        for (ExpenditureRecordTypeEnum v : values) {
            if (v.getType().equals(type)) {
                list.add(v.getCode());
            }
        }
        return list;
    }
}
